import java.util.Arrays;

class Dog {
    public String name;
    public int age;
    public String color;
    public void back() {
        System.out.println("wwww");
    }
    public void ser() {
        System.out.println("aaaaa");
    }


}
class value1 {
   public int val;
}
class value2 {
   public int val;
   public String name;
}
public class Test {
    public static void main(String[] args) {

        int[] array = {10, 20, 30, 40, 50};
        for (int x:array) {
            System.out.println(x);
        }

      /*  for (int i = 0 ; i < array.length; i++) {
            System.out.println(i);
        }*/



        /*int[]array = new int[]{10, 20, 30, 40, 50};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        System.out.println(array[3]);
        System.out.println(array[4]);*/

/*
        int[] array = {1, 2, 3};

        System.out.println(array[3]); // 数组中只有3个元素，下标一次为：0 1 2，array[3]下标越界
*/


      /*  int[]array = new int[]{10, 20, 30, 40, 50};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        System.out.println(array[3]);
        System.out.println(array[4]);
        // 也可以通过[]对数组中的元素进行修改
        array[0] = 100;
        System.out.println(array[0]);
*/

    }

  /*  public static void main22(String[] args) {
        int[] array1 = new int[5];
        String[] array2 = new String[5];
        boolean[] array3 = new boolean[5];
*/




   /* public static void swap(value1 val1,value2 val2) {
        int tmp = val1.val;
        val1.val = val2.val;
        val2.val = tmp;
    }*/

    public static void main2(String[] args) {

    /*    value1 val1 = new value1();
        val1.val = 10;
        value2 val2 = new value2();
        System.out.println(val2.val);
        val2.val = 20;
        System.out.println(val1.val);
        System.out.println(val2.val);
        swap(val1,val2);
        System.out.println(val1.val);
        System.out.println(val2.val);
*/
      /*  Dog dog = new Dog();
        dog.age = 20;
        System.out.println(dog.age);
        dog.ser();*/

    }
}
    /*public static void main(String[] args) {
        int[] s = {0};
       String ret = Arrays.toString(s);
        System.out.println(ret);
    }*/
/*    public static void main(String[] args) {
        int[][] arr = new int[2][];
        arr[0] = new int[]{1,2,3};
        arr[1] = new int[]{2,3};
        for (int[] tep:arr) {
            for (int x:tep) {
                System.out.print(x+" ");
            }
            System.out.println();
        }

        arr[1] = new int[5];

      //  System.out.println("a");
   *//*     int[][] arr = new int[3][5];
        int[][] str = {{1,2},{3,4,5},{6,7,8,9}};
        for (int[] a:str) {
            for (int x: a) {
                System.out.print(x+" ");
            }
            System.out.println();
        }

        int[][] arr1 = new int[2][];

       // arr1 = {{1,3,5},{2,2,2,2}};
        int[] arr2 = new int[2];*//*

      *//*  for (int i = 0; i < str.length; i++) {

            for (int j = 0; j < str[i].length; j++) {
                System.out.print(arr[i][j]+" ");
            }
            System.out.println();
        }*//*

     *//*   for (int i = 0; i < arr.length; i++) {

            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j]+" ");
            }
            System.out.println();
        }*//*
    }*/

